package com.yugao.fintech.antelope.shop.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yugao.fintech.antelope.base.security.utils.SecurityUtils;
import com.yugao.fintech.antelope.base.model.module.auth.LoginUser;
import com.yugao.fintech.antelope.shop.assembly.UmsMemberAssembly;
import com.yugao.fintech.antelope.shop.mapper.UmsMemberMapper;
import com.yugao.fintech.antelope.shop.model.entity.UmsMember;
import com.yugao.fintech.antelope.shop.model.rqrs.UmsMemberResp;
import com.yugao.fintech.antelope.shop.service.UmsMemberProfileService;
import org.springframework.stereotype.Service;


@Service
public class UmsMemberProfileServiceImpl extends ServiceImpl<UmsMemberMapper, UmsMember>
        implements UmsMemberProfileService {

    @Autowired
    private UmsMemberAssembly fumUserAssembly;

    @Override
    public UmsMemberResp getProfile() {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        return fumUserAssembly.toUserRS(this.getById(loginUser.getUserId()));
    }
}
